package br.ufrgs.meetapp.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import br.ufrgs.meetapp.activities.R;

public class PopupTrackOthers extends Dialog {

	private Button registerDeviceButton;
	private Button trackOthersButton;
	
	private View.OnClickListener registerDeviceListener;
	private View.OnClickListener trackOthersListener;
	
	public PopupTrackOthers(Context context) {
		super(context, R.style.PopupDialogTheme);
		setContentView(R.layout.popup_track_others);
		
		registerDeviceButton = (Button) findViewById(R.id.popup_track_others_button_register_device);
		trackOthersButton = (Button) findViewById(R.id.popup_track_others_button_track_others);
		
	}
	
	public PopupTrackOthers(Context context, View.OnClickListener _registerDeviceListener, View.OnClickListener _trackOthersListener) {
		super(context, R.style.PopupDialogTheme);
		setContentView(R.layout.popup_track_others);
		
		registerDeviceButton = (Button) findViewById(R.id.popup_track_others_button_register_device);
		trackOthersButton = (Button) findViewById(R.id.popup_track_others_button_track_others);
		
		registerDeviceListener = _registerDeviceListener;
		trackOthersListener = _trackOthersListener;
		
		if (registerDeviceListener != null){
			registerDeviceButton.setOnClickListener(_registerDeviceListener);
		}
		
		if (registerDeviceListener != null){
			trackOthersButton.setOnClickListener(_trackOthersListener);
		}
	}
	
	public View.OnClickListener getRegisterDeviceListener() {
		return registerDeviceListener;
	}

	public void setRegisterDeviceListener(View.OnClickListener _registerDeviceListener) {
		registerDeviceButton.setOnClickListener(_registerDeviceListener);
		registerDeviceListener = _registerDeviceListener;
	}

	public View.OnClickListener getTrackOthersListener() {
		return trackOthersListener;
	}

	public void setTrackOthersListener(View.OnClickListener _trackOthersListener) {
		trackOthersButton.setOnClickListener(_trackOthersListener);
		trackOthersListener = _trackOthersListener;
	}
}
